# var = "123456"
# print(var[-1::-1])
# print("\a")

# import time
# for i in range(101): # 添加进度条图形和百分比
#     bar = '[' + '=' * (i // 2) + ' ' * (50 - i // 2) + ']'
#     print(f"\r{bar} {i:3}%", end='', flush=True)
#     time.sleep(0.05)
# print()

# var=("A")
# print(ord(var))

# print("a"+"b")

# var = "never give up!"
# print("never" in var)

# print('I am %s ,my age is %d' %('小名',18))

# x = 1
# print(f'{x+1}')   # Python 3.6
#
#
# x = 1
# print(f'{x+1=}')   # Python 3.8


# tuple = (1,2,3,4)
# print(type(tuple))
# print(type(list(tuple)))

# def sayHello():
#     print("hello!")
#
# def add(a,b):
#     return a+b
#
# print(add(1,2))
#
import smtplib


import smtplib
from email.mime.text import MIMEText
from email.header import Header

# # 发件人邮箱和SMTP服务器信息
# sender = '2764739044@qq.com'
# password = 'nohrvppfhcuqdcej'  # 注意：不是登录密码，是邮箱提供的SMTP授权码
# smtp_server = 'smtp.qq.com'
#
# # 收件人
# receiver = 'suyujie185@gmail.com'
#
# # 邮件内容
# msg = MIMEText('这是一封测试邮件', 'plain', 'utf-8')
# msg['From'] = Header(sender)
# msg['To'] = Header(receiver)
# msg['Subject'] = Header('测试邮件')
#
# # 发送邮件
# try:
#     server = smtplib.SMTP(smtp_server, 587)
#     server.starttls()  #启用加密
#     server.login(sender, password)
#     server.sendmail(sender, [receiver], msg.as_string())
#     print("邮件发送成功！")
# finally:
#     server.quit()

# smtp_server = "smtp.qq.com"
# sender = "2764739044@qq.com"
# password = "nohrvppfhcuqdcej"#授权码
# receiver = "jieyusu@qq.com"
#
# message = MIMEText("测试测试","plain","utf-8")
# message["from"] = Header(sender)
# message["to"] = Header(receiver)
# message["subject"] = Header("ceshiceshi")
#
# try:
#     server = smtplib.SMTP(smtp_server,587)
#     server.starttls()
#     server.login(sender,password)
#     server.sendmail(sender,[receiver],message.as_string())
#     print("发送成功")
# except:
#     print("发送失败")
# finally:
#     server.quit()

# content of test_sample.py
def func(x):
    return x + 1


def test_answer():
    assert func(3) == 5